<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="LinkedLists,org.as3commons.collections.utils.LinkedLists,addFromArgs,addFromArray,addFromCollection,clone,copy,newLinkedList" name="keywords">
<title>org.as3commons.collections.utils.LinkedLists</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'LinkedLists - AS3Commons Collections 1.3.2';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">AS3Commons Collections 1.3.2</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?org/as3commons/collections/utils/LinkedLists.html&amp;org/as3commons/collections/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;LinkedLists</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class LinkedLists"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">org.as3commons.collections.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class LinkedLists</td>
</tr>
</table>
<p></p>
  <code>ILinkedList</code> utilities.
  
  <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addFromArgs()">addFromArgs</a>(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, ... args):uint</div>
<div class="summaryTableDescription">[static]
   Adds the given list of items to the specified list.</div>
</td><td class="summaryTableOwnerCol">LinkedLists</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addFromArray()">addFromArray</a>(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, source:Array):uint</div>
<div class="summaryTableDescription">[static]
   Adds the contents of the given <code>Array</code> to the specified list.</div>
</td><td class="summaryTableOwnerCol">LinkedLists</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addFromCollection()">addFromCollection</a>(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, source:<a href="../framework/ICollection.html">ICollection</a>):uint</div>
<div class="summaryTableDescription">[static]
   Adds the contents of the given <code>ICollection</code> to the specified list.</div>
</td><td class="summaryTableOwnerCol">LinkedLists</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clone()">clone</a>(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, filter:Function = null):<a href="../framework/ILinkedList.html">ILinkedList</a>
</div>
<div class="summaryTableDescription">[static]
   Clones the supplied <code>ILinkedList</code> instance returning a new <code>ILinkedList</code>
   of the same type.</div>
</td><td class="summaryTableOwnerCol">LinkedLists</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#copy()">copy</a>(source:<a href="../framework/ILinkedList.html">ILinkedList</a>, destination:<a href="../framework/ILinkedList.html">ILinkedList</a>, filter:Function = null):uint</div>
<div class="summaryTableDescription">[static]
   Copies items from one list to another.</div>
</td><td class="summaryTableOwnerCol">LinkedLists</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#newLinkedList()">newLinkedList</a>(... args):<a href="../../collections/LinkedList.html">LinkedList</a>
</div>
<div class="summaryTableDescription">[static]
   Creates, populates and returns a new <code>LinkedList</code> instance.</div>
</td><td class="summaryTableOwnerCol">LinkedLists</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addFromArgs()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addFromArgs</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addFromArgs(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, ... args):uint</code><p>
   Adds the given list of items to the specified list.
   
   <div class='listing'><pre>
    LinkedLists.addFromArgs(myList, item1, item2, ...);
   </pre></div>
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; The list to populate.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code>... <span class="label">args</span></code> &mdash; List of items to add to the list.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>uint</code> &mdash; The number of items added to the list.
   </td>
</tr>
</table>
</div>
<a name="addFromArray()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addFromArray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addFromArray(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, source:Array):uint</code><p>
   Adds the contents of the given <code>Array</code> to the specified list.
   
   <div class='listing'><pre>
    var array : Array = [item1, item2, ...];
    var count : uint = LinkedLists.addFromArray(list, array);
   </pre></div>
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; The list to populate.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">source</span>:Array</code> &mdash; The <code>Array</code> to add from.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>uint</code> &mdash; The number of items added to the list.
   </td>
</tr>
</table>
</div>
<a name="addFromCollection()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addFromCollection</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function addFromCollection(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, source:<a href="../framework/ICollection.html">ICollection</a>):uint</code><p>
   Adds the contents of the given <code>ICollection</code> to the specified list.
   
   <div class='listing'><pre>
    var count : uint = LinkedLists.addFromCollection(list, sourceCollection);
   </pre></div>
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; The list to populate.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">source</span>:<a href="../framework/ICollection.html">ICollection</a></code> &mdash; The <code>ICollection</code> to add from.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>uint</code> &mdash; The number of items added to the list.
   </td>
</tr>
</table>
</div>
<a name="clone()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clone</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function clone(list:<a href="../framework/ILinkedList.html">ILinkedList</a>, filter:Function = null):<a href="../framework/ILinkedList.html">ILinkedList</a></code><p>
   Clones the supplied <code>ILinkedList</code> instance returning a new <code>ILinkedList</code>
   of the same type.
   
   </p><p>If a filter is specified the resulting list only contains items that
   meet the supplied predicates.<p>
   
   <p>The filter function accepts the current item and returns a boolean
   value (<code>true</code> if the item is accepted).</p>
   
   <div class='listing'><pre>
   function itemFilter(item :  : Boolean {
    var accept : Boolean = false;
    // test the item
    return accept;
   }
     
   var list : ILinkedList = LinkedLists.clone(list, filter);
   </pre></div>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">list</span>:<a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; The <code>ILinkedList</code> instance to clone.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">filter</span>:Function</code> (default = <code>null</code>)<code></code> &mdash; Function which will be applied to each item in the source list.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; 
                        A new <code>ILinkedList</code> instance.
   
                        
                     </td>
</tr>
</table>
</div>
<a name="copy()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">copy</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function copy(source:<a href="../framework/ILinkedList.html">ILinkedList</a>, destination:<a href="../framework/ILinkedList.html">ILinkedList</a>, filter:Function = null):uint</code><p>
   Copies items from one list to another.
   
   </p><p>If a filter is specified only items are copied that meet the
   supplied predicates.<p>
   
   <p>The filter function accepts the current item and returns a boolean
   value (<code>true</code> if the item is accepted).</p>
   
   <div class='listing'><pre>
   function itemFilter(item :  : Boolean {
    var accept : Boolean = false;
    // test the item
    return accept;
   }
     
   LinkedLists.copy(sourceList, destinationList, filter);
   </pre></div>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">source</span>:<a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; The <code>ILinkedList</code> instance to copy from.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">destination</span>:<a href="../framework/ILinkedList.html">ILinkedList</a></code> &mdash; The <code>ILinkedList</code> to copy to.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">filter</span>:Function</code> (default = <code>null</code>)<code></code> &mdash; Function which will be applied to each item in the source list.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>uint</code> &mdash; The number of items copied to the list.
   </td>
</tr>
</table>
</div>
<a name="newLinkedList()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">newLinkedList</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function newLinkedList(... args):<a href="../../collections/LinkedList.html">LinkedList</a></code><p>
   Creates, populates and returns a new <code>LinkedList</code> instance.
   
   </p><p>The arguments may be left out. In that case no item is added to the list.</p>
   
   <div class='listing'><pre>
    var list : LinkedList = LinkedLists.newLinkedList(item1, item2, ...);
   </pre></div>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">args</span></code> &mdash; List of items to add to the list.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../../collections/LinkedList.html">LinkedList</a></code> &mdash; 
                        A new <code>LinkedList</code> instance populated from the given arguments.
   
                        
                     </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
